


var quan = document.querySelector(".quan")
const xhr = new XMLHttpRequest();
xhr.open("get","http://chst.vip:1234/api/getcoupon")
xhr.send();
xhr.onload = function(){
    let res = JSON.parse(xhr.responseText)
    console.log(res);
    console.log(res.result);
    let ele = ""
    res.result.forEach(item => {
        ele += `<a href="${item.couponLink}?couponId=${item.couponId}" couponId="${item.couponId}">
                ${item.couponTitle}</a>`
    });
    quan.innerHTML = ele
}